import json


class UserInfo:
    name = ''
    email = ''
    password = ''
    qq = ''

    def __init__(self, name=None, email=None, password=None, qq=None):
        self.name = name
        self.email = email
        self.password = password
        self.qq = qq

    def __str__(self):
        return "姓名：%s, 邮箱：%s, 密码：%s, QQ：%s" % (self.name, self.email, self.password, self.qq)


f = open("json.txt", "r")
data = json.load(f)
# print(data)
user_list = []
for user in data:
    user = UserInfo(name=user["name"], email=user["email"], password=user["password"], qq=user["qq"])
    user_list.append(user)

for user in user_list:
    print(user)
a = UserInfo()
